<template>
    <div class="setting">
      <div class="title">
        <div class="back-wrapper"><back></back></div>
        设置
      </div>
      <div class="content">
        <div class="cell-block" @click="$router.push('/changePassword')">
          修改密码
        </div>
        <div class="btn-wrapper">
          <button class="btn-logout" @click="_clearStorage">退出登录</button>
          <p class="text">客服电话：<a href="tel:400-801-1880">400-801-1880</a></p>
        </div>
      </div>
    </div>
</template>

<script>
    import back from '../../../components/back/back'
    import {setStorage,getStorage} from "../../../common/js/localStorage";
    import {Toast} from 'mint-ui'

    export default {
        name: "setting",
        components:{
          'back':back
        },
        methods:{
          _clearStorage(){
            setStorage('userInfo','')

            if(getStorage('userInfo')===''){
              Toast('退出成功')
              let _this = this
              setTimeout(()=>{
                _this.$router.push({path:'/index/user'})
              },1000)
            }
          }
        }
    }
</script>

<style scoped lang="stylus">
  .setting
    position absolute
    height 100%
    width 100%
    background #101011
    user-select none
    .title
      position relative
      padding-top 10px
      height 22px
      line-height 22px
      text-align center
      font-size 16px
      color #ffffff
      .back-wrapper
        position absolute
        left 0
        top 10px
        width 36px
        height 22px
    .content
      height calc(100% - 55px)
      .cell-block
        margin-top 23px
        height 52px
        background #171718 url("arrow_right.svg") no-repeat calc(100% - 10px) center /9px 13px
        padding 0 10px
        text-align left
        line-height 52px
        font-size 16px
        color #ffffff
        &:active
          background #2e2f31 url("arrow_right.svg") no-repeat calc(100% - 10px) center /9px 13px
      .btn-wrapper
        position absolute
        bottom 0
        width calc(100% - 30px)
        height 118px
        padding 0 15px
        .btn-logout
          height 50px
          width 100%
          border-radius 6px
          border none
          background #F7C20F
          color #222426
          outline none
          &:active
            background #ebb90e
        .text
          padding-top 27px
          color #666666
          font-size 14px
          a
            color #F7C20F
</style>
